package com.ssn.observer.school;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;

public class Client {
    public static void main(String[] args) {
        Subject dept = new Dept();
        Student s1 = new Student("S1");
        Student s2 = new Student("S2");
        Student s3 = new Student("S3");
        Teacher t1 = new Teacher("T1");
        Teacher t2 = new Teacher("T2");
        Teacher t3 = new Teacher("T3");
        List<Observer> observerList = new ArrayList<>(Arrays.asList(s1,s2,s3,t1,t2,t3));
        for (Observer oo: observerList) {
            dept.attach(oo);
        }
        dept.notify("数计");
    }
}
